var uprofile = {};

uprofile.Application = function(){};
core.extendClass('uprofile.Application', 'core.JSApplication');


uprofile.Dialog = function(){};
core.extendClass('uprofile.Dialog', 'core.JSDialog');

uprofile.Dialog.prototype.createDialog = function(aData){

var instance = this;
    var dlg = new core.Dialog({
        title: 'User profile:',
        maxWidth: 450,
        columns: '0.2, 0.8',
        rows: 'd, d, d, d, d, d',
        data: aData,
        items: [
            core.createLabel('Time zone:'),
            new core.form.ComboBox({
                id: 'time_zone',
                options: uprofile.tz
            }),
             new core.Label({
                text: 'Change password:',
                colspan: 2,
                align: 'left'
            }),
            core.createLabel('Old password:'),
            new core.form.TextField({
                id: 'old_pass',
                password: true
            }),
            core.createLabel('New password:'),
            new core.form.TextField({
                id: 'new_pass',
                password: true
            }),
            core.createLabel('Retype password:'),
            new core.form.TextField({
                id: 'new_pass2',
                password: true
            }),
            core.ui.createButtons({
                colspan: 2,
                align: 'right',
                buttons: ['Ok', 'Cancel'],
                handler: function(index){
                    instance.send({
                        method: index==0?'okClick':'closeDialog',
                        message: dlg.body.getValue(),
                        disable: dlg
                    });
                }
            })
       ]
    });
    return dlg;
};
